home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmiSoft / Util / libs / ExtraLib.lha / Extra / Demos / StringDemo.BAS < prev    next >
BASIC Source File  |  2004-05-30  |  2KB  |  53 lines

  1. ' ___________________________________________________________________________
  2. ' |*************************************************************************|
  3. ' |*|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|*|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|*|
  4. ' |*| Set TAB to 4 for best readable file layout.  |*|  Maxon Basic 3.00  |*|
  5. ' |*|______________________________________________|*|____________________|*|
  6. ' |*************************************************************************|
  7. ' |*|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|*|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|*|
  8. ' |*|               |*|  $Id: StringDemo.BAS (07.10.03)                   |*|
  9. ' |*| ###### ###### |*|  RhoSigma Source based on NDK 3.1 Includes 40.15  |*|
  10. ' |*| ##  ## ##   # |*| _________________________________________________ |*|
  11. ' |*| ##  ##  ##    |*|                                                   |*|
  12. ' |*| ######   ##   |*|  Demo to show use of GETSTRING$-SUB in »extra.bc« |*|
  13. ' |*| ##      ##    |*|                                                   |*|
  14. ' |*| ##     ##   # |*| ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ |*|
  15. ' |*| ##     ###### |*|  Copyright © 1998-2002 RhoSigma, Roland Heyder    |*|
  16. ' |*|               |*|  All Rights Reserved.                             |*|
  17. ' |*|_______________|*|___________________________________________________|*|
  18. ' |*************************************************************************|
  19. ' ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  20.  
  21. '$TO        StringDemoBAS
  22. '$ICONS
  23. '$NOLIBRARY
  24.  
  25. '$INCLUDE    exec.bc
  26. '$INCLUDE    settings.bc
  27. '$INCLUDE    extra.bh
  28.  
  29. DATA "$VER: StringDemoBAS 4.215 (07.10.03)"
  30.  
  31. LIBRARY OPEN "extra",4
  32.  
  33. LINE INPUT "Bitte geben Sie eine Dezimal-Zahl ein: ";z$
  34. z&=VAL(z$)
  35. PRINT
  36.  
  37. b&=Int32ToString&(z&,TRUE&,2)
  38. o&=Int32ToString&(z&,TRUE&,8)
  39. h&=Int32ToString&(z&,TRUE&,16)
  40.  
  41. b$=GETSTRING$(b&)
  42. o$=GETSTRING$(o&)
  43. h$=GETSTRING$(h&)
  44.  
  45. PRINT "Die angegebene Zahl convertiert auf andere Zahlen-Basen:"
  46. PRINT
  47. PRINT "      binär: ";b$
  48. PRINT "      octal: ";o$
  49. PRINT "hexadezimal: ";h$
  50.  
  51. LIBRARY CLOSE
  52. END
  53.